package com.example.xss.commom.validation.annotation;

import com.example.xss.commom.validation.EnumValueValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 枚举校验注解
 * @author WANGJIET24
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {EnumValueValidator.class})
public @interface EnumValueCheck {

    String message() default "校验失败";

    Class<?> enumClass() default Void.class;

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default {};

}
